//
//  QTextFild.m
//  QMCXDriver
//
//  Created by Massimo on 2017/4/15.
//  Copyright © 2017年 Massimo. All rights reserved.
//

#import "QTextFild.h"

@implementation QTextFild

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
 

- (void)drawPlaceholderInRect:(CGRect)rect{
    
    NSString *value = self.placeholder;
    
    NSDictionary *attributes = @{NSForegroundColorAttributeName:LLColorRGB(159, 156, 170),NSFontAttributeName:[UIFont systemFontOfSize:16]};
    
   CGSize sizeToFit = [value sizeWithAttributes:attributes]; 
    CGRect pRect = CGRectMake(0, (rect.size.height - sizeToFit.height)/2.f, CGRectGetWidth(rect), sizeToFit.height);
     
    [self.placeholder drawInRect:pRect withAttributes:attributes];
}


@end
